package com.we.scrm.common.enums;

import com.we.scrm.bean.simpleObj;
import com.we.scrm.bean.simpleStrObj;
import org.apache.ibatis.annotations.Update;

import java.util.*;


public enum TagsTypeEnum {
    DEFAULT("default","默认"),
    PRIMARY("primary","粉丝"),
    SUCCESS("success","地区"),
    WARNING("warning","来源"),
    DANGER("danger","学生"),
    ;

    private String code;
    private String name;

    TagsTypeEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return this.code;
    }

    public static String getNameByCode(String value){
        for(TagsTypeEnum item : TagsTypeEnum.values()){
            if(item.code.equals(value)){
                return item.getName();
            }
        }
        return null;
    }
    public static List<simpleStrObj> toList(){
        List<simpleStrObj> list = new ArrayList<simpleStrObj>();
        for(TagsTypeEnum item : TagsTypeEnum.values()){
            simpleStrObj obj = new simpleStrObj(item.code,item.name);
            list.add(obj);
        }
        return list;
    }
}

